package com.ruicar.afs.cloud.common.mq.rabbit.listener;

import com.ruicar.afs.cloud.common.mq.rabbit.message.MqTransCode;

/**
 * The type AfsMqBizProcess
 * <p>Description: </p>
 * mq消息业务处理类
 *
 * @author Fzero
 * @version 1.0
 * @date Created on 2020.06.20 10:38:43
 * @since 1.0
 */
public interface AfsMqBizProcessor<T> {
    /**
     * Process message boolean
     *
     * @param entity afs trans entity
     * @return the boolean
     * @throws Exception exception
     */
    boolean processMessage(T entity) throws Exception;


    /**
     * Gets code *
     *
     * @return the code
     */
    MqTransCode getCode();


    /**
     * Re queue on fail boolean
     * 消费失败是否返回队列 默认不返回
     *
     * @return the boolean
     */
    default boolean reQueueOnFail() {
        return false;
    }
}
